#include <standard.hlsli>
#include <cobra11syndicate.hlsli>

struct VertexToPixel
{
	float4 pos : SV_POSITION;
	float4 texCoord1 : TEXCOORD0;
	float4 texCoord2 : TEXCOORD1;
	float4 texCoord3 : TEXCOORD2;
	float4 kBlend : COLOR0;
	float4 kColor : COLOR1;
	float4 pos2 : TEXCOORD5;
	float3 normal : TEXCOORD6;
	float foger : FOG;
};

VertexToPixel vs_main(VS_INPUT_C11 Input)
{
	VertexToPixel Output = (VertexToPixel)0;
	//float3 madResult = mad(float3(1, 2, 3), 4, 5);
	Output.pos = float4(mul(Input.Position, worldViewProj));
	Output.normal = normalize(mul(Input.Normal, (float3x3)world));
	Output.kBlend = Input.kblend;
	//Output.kBlend.xyz = Output.kBlend.xyz;// +madResult;

	// Calculate the camera position.
	float4 v_CameraPosition = mul(Input.Position, world);
		v_CameraPosition = mul(v_CameraPosition, view);

	// Calculate linear fog.
	Output.foger =   saturate((fogEnd - v_CameraPosition.z) / (fogEnd - fogStart));
	Output.pos2.xyz = Input.Position.xyz;
	return Output;
};